package com.ocm.core.model;

import java.util.ArrayList;

import com.ocm.core.domain.AssociationType;

public class ReferenceValue extends ArrayList<Object> {

   private static final long serialVersionUID = 1L;

   public enum ITEM_STATUS {
      NEW, REMOVE
   }

   private AssociationType associationType;

   private ReferenceValue(){
      
   }

   public AssociationType getAssociationType() {
      return associationType;
   }

   public void setAssociationType(AssociationType associationType) {
      this.associationType = associationType;
   }

   public static ReferenceValue getInstance(){
      return new ReferenceValue();
   }

   public boolean addUUID(String arg0) {
      ReferenceValueModel referenceValueModel = new ReferenceValueModel();
      referenceValueModel.setUUID(arg0.toString());
      referenceValueModel.setItemStatus(ITEM_STATUS.NEW);
      return super.add(referenceValueModel);
   }

   public boolean removeUUID(String arg0) {
      ReferenceValueModel referenceValueModel = new ReferenceValueModel();
      referenceValueModel.setUUID(arg0.toString());
      referenceValueModel.setItemStatus(ITEM_STATUS.REMOVE);
      return super.add(referenceValueModel);
   }

   public String getUUID(int index) {
      ReferenceValueModel referenceValueModel = (ReferenceValueModel) this.get(index);
      return referenceValueModel.getUUID();
   }

   public ITEM_STATUS getItemStatus(int index) {
      ReferenceValueModel referenceValueModel = (ReferenceValueModel) this.get(index);
      return referenceValueModel.itemStatus;
   }

   class ReferenceValueModel {
      private String uuid;

      private ITEM_STATUS itemStatus;

      public String getUUID() {
         return uuid;
      }

      public void setUUID(String uuid) {
         this.uuid = uuid;
      }

      public ITEM_STATUS getItemStatus() {
         return itemStatus;
      }

      public void setItemStatus(ITEM_STATUS itemStatus) {
         this.itemStatus = itemStatus;
      }
   }
}
